<?php
/*
 * This file is part of SoftSite.
 *
 * (c) 2012 Steve Tredinnick
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

/**
 *
 *
 * @package softsite
 * @author  Steve Tredinnick <steve.tredinnick@gmail.com>
 */

namespace Lib\Forms\Elements;

use Lib\Forms\Elements\InputElement;

class CheckBoxElement extends InputElement
{

    public function __construct()
    {
        parent::__construct();
        $this->SetType("checkbox");
    }

    private function ValidateHTML()
    {

    }

    /**
     * @desc Returns the generated HTML for the view.
     * @return string Generated HTML for the view.
     */
    public function RenderElement()
    {
        $this->GenerateHtml();
        return $this->formHtml;
    }
    
    /*
     * @desc Sets the checked status of the check box, defaults to not checked.
     */
    public function SetChecked($checked = false)
    {
        if ($checked) 
        {
           $this->checked = " checked "; 
        }
    }

}
